<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <style>
        html,
        body,
        #viewDiv {
            padding: 0;
            margin: 0;
            height: 100%;
            width: 100%;
        }

        #sidebar {
            z-index: 99;
            position: absolute;
            top: 0;
            right: 0;
            height: 100%;
            background: rgba(0, 0, 0, 0.5);
            width: 320px;
        }

        #text {
            color: white;
            padding: 3%;
        }
    </style>
    <link href="https://js.arcgis.com/4.21/esri/themes/light/main.css" rel="stylesheet"/>
    <script src="https://js.arcgis.com/4.21/"></script>
    <script>
        require(["esri/Map", "esri/views/MapView"], function (Map, MapView) {
            var map = new Map({
                basemap: "topo-vector"
            });

            var view = new MapView({
                container: "viewDiv",
                map: map,
                center: [-74.045459, 40.690083],
                zoom: 16,
                padding:{
                    right:500,//把view.center位置中心往左移动
                }
            });
        });
    </script>
</head>
<body>
<div id="viewDiv">
    <div id="sidebar" class="esri-widget">
        <div id="text">
            <h1>自由岛</h1>
            <p>
                请注意，设置 view.padding 会使 view.center、view.extent 等脱离完整视图的一部分。
            </p>
            <p>尝试调整窗口大小以获得更好的理解</p>
        </div>
    </div>
</div>
</body>
</html>
